<!--
 * @Descripttion: 
 * @version: 1.0
 * @Author: Sam
 * date: 2021-09-07 20:25:16
 * @LastEditors: Sam
 * @LastEditTime: 2021-09-27 11:58:27
-->
{include file="common@public/header"}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-card">
            <div class="layui-card-header">{$page_title}</div>
            <div class="layui-card-body">
                <form class="layui-form padsome" action="">  
                    <div class="layui-form-item" >
                        <div class="layui-form-label">select单选</div>
                        <div class="layui-input-block">
                            <select  name="select"  lay-search >
                                <option value="">请选择select单选</option>
                                <option value="1">选项1</option>
                                <option value="2">选项2</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">select多选</div>
                        <div class="layui-input-block">
                            <div id='selects'></div>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">普通文本</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="text"  lay-verify="required"  placeholder="请输入普通文本"  value=""/>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">单图</div>
                        <div class="layui-input-block">
                            <input type="hidden" name="pic" id="pic" value='' />
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">多图</div>
                        <div class="layui-input-block">
                            <input type="hidden" name="pics" id="pics" value='' />
                        </div>
                    </div>
                  <div class="layui-form-item" >
                      <div class="layui-form-label">视频</div>
                      <div class="layui-input-block">
                          <input type="hidden" name="video" id="video" value='' />
                      </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">数字</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="number"  placeholder="请输入数字"  type="number"  value=""/>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">单选</div>
                        <div class="layui-input-block">
                            <input type="radio"  name="radio"  title="显示" checked value="1" />
                            <input type="radio"  name="radio"  title="隐藏"  value="0" />
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">多选</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="checkbox"  type="checkbox"  title="显示" value="1"  />
                            <input class="layui-input"  name="checkbox"  type="checkbox"  title="隐藏" value="0"  />
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">多选风格切换</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="checkbox2"  lay-skin="primary"  type="checkbox"  title="显示" value="1"  />
                            <input class="layui-input"  name="checkbox2"  lay-skin="primary"  type="checkbox"  title="隐藏" value="0"  />
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">密码</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="pic"  placeholder="请输入密码"  type="password"  value=""/>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">文本域</div>
                        <div class="layui-input-block">
                            <textarea class="layui-textarea"  name="textarea"  placeholder="请输入文本域" ></textarea>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-inline">
                            <div class="layui-form-label">行内样式</div>
                            <div class="layui-input-inline">
                                <input class="layui-input"  name="text"  lay-verify="required"  placeholder="请输入行内样式"  value=""/>
                            </div>
                            <div class="layui-form-label">行内样式</div>
                            <div class="layui-input-inline">
                                <input class="layui-input"  name="text"  lay-verify="required"  placeholder="请输入行内样式"  value=""/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">日期</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="date"  readonly placeholder="请选择日期"  id="date"  value=""/>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">日期时间</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="datetime"  readonly placeholder="请选择日期时间"  id="datetime"  value=""/>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">时间</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="time"  readonly placeholder="请选择时间"  id="time"  value=""/>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">时间范围</div>
                        <div class="layui-input-block">
                            <input class="layui-input"  name="datetime_range"  readonly placeholder="请选择时间"  id="datetime_range"  value=""/>
                        </div>
                    </div>
                    <div class="layui-form-item" id="area-picker" >
                        <div class="layui-form-label">省</div>
                        <div class="layui-input-block">
                            <div class="layui-input-inline">
                                <select name="time" class="province-selector" data-value="" lay-search></select>
                            </div>
                            <div class="layui-form-label">市</div>
                            <div class="layui-input-inline">
                                <select name="city" class="city-selector" data-value="" lay-search></select>
                            </div>
                            <div class="layui-form-label">区</div>
                            <div class="layui-input-inline">
                                <select name="county" class="county-selector" data-value="" lay-search></select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item" >
                        <div class="layui-form-label">富文本</div>
                        <div class="layui-input-block">
                            <textarea name="editor" id="editor" style="width: 100%; height: 500px;"></textarea>
                        </div>
                    </div>                    
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn" lay-submit="">立即提交</button>
                            </div>
                        </div>
                        <div class="layui-input-block layui-layout-admin">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn" lay-submit="">立即提交(iframe模式)</button>
                                <button class="layui-btn layui-btn-primary" type="button" onclick="close_frame()">返回</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{include file="common@public/ueditor" /}
{include file="common@public/umeditor" /}
{include file="common@public/footer" /}
<script>
    layui.extend({
        xmSelect: 'xm-select'
    }).use(['index', 'form', 'layarea', 'laydate', 'xmSelect'], function(){
        var $       = layui.$;
        var form    = layui.form;
        // var xmSelect = layui.xmSelect;
        uploadInit('pic', 'image', '');
        uploadInit('pics', 'images', '');
        uploadInit('video', 'video', '');
        layui.laydate.render({elem:'#date', type:'date',trigger:'click'});
        layui.laydate.render({elem:'#datetime', type:'datetime',trigger:'click'});
        layui.laydate.render({elem:'#time', type:'time',trigger:'click'});
        layui.laydate.render({elem:'#datetime_range', type:'datetime',trigger:'click',range:true});
        layui.layarea.render({elem:'#area-picker'});
        UE.getEditor('editor');
        xmSelect.render({el: '#selects', filterable: true,name:'selects', data: [{"value":1,"name":"选项1"},{"value":2,"name":"选项2"}], initValue: []});
        form.render();
        
        // 监听表单提交
        form.on('submit()', function(data){
            Post('', data.field, function(res) {
                if (res.code == 1) {
                    alert_success(res.msg, function() {
                        parent.layui.table.reload('table', {where: parent.where});
                        close_frame();
                    })
                } else {
                    alert_error(res.msg);
                }
            });
            return false;
        });

    <?php $extend_tpl = isset($tpl) ? file_get_contents($tpl) : ''; echo str_replace(['<script>', '</script>'], ['', ''], $extend_tpl)?>
});
</script>